package com.jds.test.http;

/**
 * Created by sunyuming on 18/8/30.
 */

/**
 * Created by sunyuming on 18/6/15.
 */
public class ResponseMessage {

    private Integer code;
    private String message;
    private Object result;

    private ResponseMessage() {}

    /**
     * 创建成功缺省返回
     * @return
     */
    public static ResponseMessage genSuccess() {
        return new ResponseMessage().setCode(0).setMessage("成功");
    }

    public static ResponseMessage genFail() {
        return new ResponseMessage().setCode(-1).setMessage("失败");
    }

    public Integer getCode() {
        return code;
    }

    public ResponseMessage setCode(Integer code) {
        this.code = code;
        return this;
    }

    public String getMessage() {
        return message;
    }

    public ResponseMessage setMessage(String message) {
        this.message = message;
        return this;
    }

    public Object getResult() {
        return result;
    }

    public ResponseMessage setResult(Object result) {
        this.result = result;
        return this;
    }
}
